package design.abstractfactory;

import design.factory.*;

/**
 * User: heihaier@xfuweng.com
 * Date: 2015/7/10
 * Time: 11:39
 */
public class ColorFactory extends AbstractFactory {

    @Override
    public Color getColor(String type) {

        Color color = null;

        switch (type) {

            case "red":
                color = new Red();
                break;
            case "yellow":
                color = new Yellow();
                break;
            case "green":
                color = new Green();
                break;
            default:
                break;
        }

        return color;
    }

    @Override
    public Shape getShap(String type) {
        return null;
    }
}
